<template>
	<div>
		<el-form :model="form.editParamInfo">

		    <el-form-item label="名称" :label-width="formLabelWidth">
		      <el-input v-model="form.editParamInfo.name"></el-input>
		    </el-form-item>

		    <el-form-item label="参数" :label-width="formLabelWidth">
		      <el-input v-model="form.editParamInfo.param" :disabled="true"></el-input>
		    </el-form-item>

		    <el-form-item label="文本类型" :label-width="formLabelWidth">
		      <el-input v-model="form.editParamInfo.type" :disabled="true"></el-input>
		    </el-form-item>

		    <el-form-item label="备注说明"  :label-width="formLabelWidth" >
		      	<el-input v-model="form.editParamInfo.mark"></el-input>
		    </el-form-item>

		  </el-form>
		  <div class="dialog-footer">
		  		<span slot="footer" >
			    <el-button @click="closeDialog">取 消</el-button>
			    <el-button type="primary" @click="dialogOkBtn">确 定</el-button>
			  </span>
		  </div>

	</div>
</template>

<script>

import _http from '../common/http.vue'
export default{
	props:['paramInfo'],
	data(){
		return {
			form:{
				editParamInfo:{
					id:'',
					name:'',
					param:'',
					type:'',
					mark:''
				}
			},
			formLabelWidth:'120px'
		}
	},

	mounted(){
		this.editParamInfoInit()
	},
	methods:{
		editParamInfoInit(){
			this.form.editParamInfo.id = this.paramInfo.id
			this.form.editParamInfo.name = this.paramInfo.name
			this.form.editParamInfo.param = this.paramInfo.param
			this.form.editParamInfo.type = this.paramInfo.type
			this.form.editParamInfo.mark = this.paramInfo.mark
		},
		closeDialog(){
			this.$emit('closeDialog')
		},
		dialogOkBtn(){
    		_http.axiosRequest(this,'configEditParam',{form:this.form.editParamInfo},(res)=>{
    			if (_http.apiResult(this,res.data)) {
    				this.$emit('closeDialog')
    				this.$emit('freshList')
    			}
    		})
		}
	}

}	

</script>